﻿@model ZJK.Models.ExpertManage.ExpertConfirmList
@{
    ViewBag.Title = "专家验证管理";
    Layout = "~/Views/Shared/ExpertManage/_Layout_ExpertManage.cshtml";
}
<h2>
    @ViewBag.Title</h2>
<div class="ui-widget-content ui-corner-all" style="padding: 0.7em;">
    @using (Html.BeginForm("ConfirmList", "ExpertManage", FormMethod.Post, new { id = "form_op" }))
    {
        @Html.HiddenFor(m => m.pageSize)
        @Html.HiddenFor(m => m.pageCount)
        @Html.HiddenFor(m => m.pageIndex)
        @Html.HiddenFor(m => m.recordCount)
        <div style="position: relative; width: 25%; float: left;">
            <div class="ui-widget-header ui-corner-all" style="position: relative; padding: 0.7em;">
                <b>请输入查询条件：</b>
            </div>
        </div>
        <div style="width: 25%; float: right; padding: 0.7em;">
            根据项目编号或者项目名称查询备选记录。
        </div>
        <div style="position: relative; margin-left: 25%; margin-right: 25%; overflow: hidden;">
            <div class="ui-widget-content ui-corner-all" style="padding: 0.7em;">
                <script type="text/javascript">
                    function queryProjectExtract() {
                        //设置
                        $("#form_op").submit();
                    }
                </script>
                @Html.TextBoxFor(m => m.queryCondiction.Q_project_name)
                <span class="btn" onclick="javascript:queryProjectExtract();">查询</span>
            </div>
        </div>
        <div class="splid">
        </div>
        <table style="border-collapse: collapse; width: 100%;">
            <tr>
                <th class="ui-widget-header" style="padding: .5em; white-space: nowrap;">序号
                </th>
                <th class="ui-widget-header" style="padding: .5em; white-space: nowrap;">项目名称
                </th>
                <th class="ui-widget-header" style="padding: .5em; white-space: nowrap;">备选抽取标题
                </th>
                <th class="ui-widget-header" style="padding: .5em; white-space: nowrap;">备选专家
                </th>
                <th class="ui-widget-header" style="padding: .5em; white-space: nowrap;">抽取记录创建时间
                </th>
            </tr>
            @for (int i = 0; i < @Model.projectExtractBaks.Count; i++)
            {
                <tr>
                    <td style="padding: .5em;" class="ui-state-default">
                        @{
                int row_idx = @Model.pageIndex * @Model.pageSize + i + 1;
                        }
                        @row_idx.ToString()
                    </td>
                    <td style="padding: .5em;" class="ui-state-default">
                        <div>
                            <span>[</span>@Model.projectExtractBaks[i].projectCode
                            <span>]</span>@Model.projectExtractBaks[i].projectName
                        </div>
                        @if (!string.IsNullOrEmpty(Model.projectExtractBaks[i].extractID))
                        {
                            <div>
                                <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                                @Html.ActionLink("新备选", "BakForExtract", new { proj_id = @Model.projectExtractBaks[i].projectID }, new { onclick = @"return confirm('当前项目已经有抽取记录，重新设置将会将以前的抽取记录关联取消。\r\n真的要执行吗？')" })
                            </div>
                        }
                        else
                        {
                            <div>
                                <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                                @Html.ActionLink("新备选", "BakForExtract", new { proj_id = @Model.projectExtractBaks[i].projectID })
                            </div>
                        }
                    </td>
                    <td style="padding: .5em;" class="ui-state-default">
                        <a href="BakForExtract?bak_id=@Model.projectExtractBaks[i].extractID" title="点击查看并修改备选记录">
                            @Model.projectExtractBaks[i].extractTitle
                        </a>
                    </td>
                    <td style="padding: .5em;" class="ui-state-default">
                        @for (int j = 0; j < @Model.projectExtractBaks[i].extractDetails.Count; j++)
                        {
                            <div style="white-space: nowrap;">
                                @Model.projectExtractBaks[i].extractDetails[j].expertName
                                <span>[</span>@Model.projectExtractBaks[i].extractDetails[j].expertMobile<span>]</span>
                                @if (@Model.projectExtractBaks[i].extractDetails[j].expertIsSelected==-1)
                                { 
                                    <span style="color: Red;">不内定</span> 
                                }
                                else if (@Model.projectExtractBaks[i].extractDetails[j].expertIsSelected == 0)
                                { 
                                    <span style="color: Red;">不参加</span> 
                                }
                            </div>
                        }
                    </td>
                    <td style="padding: .5em;" class="ui-state-default">
                        @if (@Model.projectExtractBaks[i].createDate > DateTime.MinValue)
                        {
                            @Model.projectExtractBaks[i].createDate.ToString("yyyy-MM-dd")
                        }
                    </td>
                </tr>
            }
        </table>
        @Html.HiddenFor(m => m.pageIndex, new { @id = "pageIndex" })
        <script type="text/javascript">
            function go(idx) {
                //设置
                $("#pageIndex").attr({ value: idx });
                $("#form_op").submit();
            }
        </script>
        <table class="pbgrid">
            <tr>
                <td>&nbsp;&nbsp;
                </td>
                <td>
                    @if (@Model.pageIndex == 0)
                    {
                        <span>◀◀首页</span>
                    }
                    else
                    {
                        <span>◀◀</span><a href="javascript:go(0);">首页</a>
                    }
                </td>
                <td>&nbsp;&nbsp;
                </td>
                <td>
                    @if (@Model.pageIndex > 0 && @Model.pageIndex < @Model.pageCount)
                    {
                        int i = @Model.pageIndex - 1;
                        <span>◀</span><a href="javascript:go(@i)">上页</a>
                    }
                    else
                    {
                        <span>◀上页</span>
                    }
                </td>
                <td>&nbsp;&nbsp;
                </td>
                <td>
                    @{
                    int this_page = @Model.pageIndex + 1;
                    }
                    [第 @this_page 页/共 @Model.pageCount 页]
                </td>
                <td>&nbsp;&nbsp;
                </td>
                <td>
                    @if (@Model.pageIndex >= 0 && @Model.pageIndex < @Model.pageCount - 1)
                    {
                        int i = @Model.pageIndex + 1;
                        <a href="javascript:go(@i)">下页</a><span>▶</span>
                    }
                    else
                    {
                        <span>下页</span><span>▶</span>
                    }
                </td>
                <td>&nbsp;&nbsp;
                </td>
                <td>
                    @if (@Model.pageIndex < @Model.pageCount - 1)
                    {
                        int i = @Model.pageCount - 1;
                        <a href="javascript:go(@i);">末页</a><span>▶▶</span>
                    }
                    else
                    {
                        <span>末页</span><span>▶▶</span>
                    }
                </td>
                <td>&nbsp;&nbsp;
                </td>
            </tr>
        </table>
    }
</div>
